<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set the interpolation method</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.imagesetclip.html">« imagesetclip</a></li>
      <li style="float: right;"><a href="function.imagesetpixel.html">imagesetpixel »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.image.html">GD 和图像处理 函数</a></li>
    <li>Set the interpolation method</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.imagesetinterpolation" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagesetinterpolation</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagesetinterpolation</span> &mdash; <span class="dc-title">Set the interpolation method</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagesetinterpolation-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagesetinterpolation</strong></span>(<span class="methodparam"><span class="type"><a href="class.gdimage.html" class="type GdImage">GdImage</a></span> <code class="parameter">$image</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$method</code><span class="initializer"> = <strong><code>IMG_BILINEAR_FIXED</code></strong></span></span>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   Sets the interpolation method, setting an interpolation method affects the rendering 
   of various functions in GD, such as the <span class="function"><a href="function.imagerotate.html" class="function">imagerotate()</a></span> function.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imagesetinterpolation-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    <dt>

<code class="parameter">image</code></dt>
<dd>
<p class="para">由图象创建函数(例如<span class="function"><a href="function.imagecreatetruecolor.html" class="function">imagecreatetruecolor()</a></span>)返回的 
<span class="classname"><a href="class.gdimage.html" class="classname">GdImage</a></span> 对象。</p></dd>

    
     <dt>
<code class="parameter">method</code></dt>

     <dd>

      <p class="para">
       The interpolation method, which can be one of the following:
       <ul class="itemizedlist">
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_BELL</code></strong>: Bell filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_BESSEL</code></strong>: Bessel filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_BICUBIC</code></strong>: Bicubic interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_BICUBIC_FIXED</code></strong>: Fixed point implementation of the bicubic interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_BILINEAR_FIXED</code></strong>: Fixed point implementation of the  bilinear interpolation (<code class="literal">default (also on image creation)</code>).
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_BLACKMAN</code></strong>: Blackman window function.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_BOX</code></strong>: Box blur filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_BSPLINE</code></strong>: Spline interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_CATMULLROM</code></strong>: Cubic Hermite spline interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_GAUSSIAN</code></strong>: Gaussian function.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_GENERALIZED_CUBIC</code></strong>: Generalized cubic spline fractal interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_HERMITE</code></strong>: Hermite interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_HAMMING</code></strong>: Hamming filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_HANNING</code></strong>: Hanning filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_MITCHELL</code></strong>: Mitchell filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_POWER</code></strong>: Power interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_QUADRATIC</code></strong>: Inverse quadratic interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_SINC</code></strong>: Sinc function.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_NEAREST_NEIGHBOUR</code></strong>: Nearest neighbour interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_WEIGHTED4</code></strong>: Weighting filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code>IMG_TRIANGLE</code></strong>: Triangle interpolation.
         </span>
        </li>
       </ul>
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imagesetinterpolation-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>true</code></strong>， 或者在失败时返回 <strong><code>false</code></strong>。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagesetinterpolation-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">image</code> expects a <span class="classname"><a href="class.gdimage.html" class="classname">GdImage</a></span>
  instance now; previously, a <span class="type">resource</span> was expected.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imagesetinterpolation-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2701">
    <p><strong>示例 #1 <span class="function"><strong>imagesetinterpolation()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Load&nbsp;an&nbsp;image<br /></span><span style="color: #0000BB">$im&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecreate</span><span style="color: #007700">(</span><span style="color: #0000BB">500</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">500</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;By&nbsp;default&nbsp;interpolation&nbsp;is&nbsp;IMG_BILINEAR_FIXED,&nbsp;switch&nbsp;<br />//&nbsp;to&nbsp;use&nbsp;the&nbsp;'Mitchell'&nbsp;filter:<br /></span><span style="color: #0000BB">imagesetinterpolation</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IMG_MITCHELL</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Continue&nbsp;to&nbsp;work&nbsp;with&nbsp;$im&nbsp;...<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.imagesetinterpolation-notes">
  <h3 class="title">注释</h3>
  <p class="para">
   Changing the interpolation method affects the following functions 
   when rendering:

   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      <span class="function"><a href="function.imageaffine.html" class="function">imageaffine()</a></span>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <span class="function"><a href="function.imagerotate.html" class="function">imagerotate()</a></span>
     </span>
    </li>
   </ul>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imagesetinterpolation-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="function.imagegetinterpolation.html" class="function" rel="rdfs-seeAlso">imagegetinterpolation()</a> - Get the interpolation method</span></li>
  </ul>
 </div>


</div></div></div></body></html>